import { axiosAPI, url } from '.././request/request'

// 登录
export const login = (data) => {
  return axiosAPI(`${url}/user/user/user_login`, data, 'POST')
}

// 用户信息
export const getUserInfo = () => {
  return axiosAPI(`${url}/user/user/get_user`, 'GET')
}

// 填写用户信息
export const tiedUser = (data) => {
  return axiosAPI(`${url}/user/user/tied_student`, data, 'POST')
}

// 退出登录
export const logout = (data) => {
  return axiosAPI(`${url}/user/user/user_login_out`, 'GET')
}

// 课程表
export const getCourseList = (week, semesterId) => {
  return axiosAPI(week!==undefined&&semesterId!==undefined?`${url}/user/course/get_user_course_list?week=`+week+'&semesterId='+semesterId:`${url}/user/course/get_user_course_list`, 'GET')
}

// 学期列表
export const allSemesterList = () => {
  return axiosAPI(`${url}/list/api/get_semester_list_api`, 'GET')
}

// 水卡余额
export const getWaterMoney = () => {
  return axiosAPI(`${url}/user/water/get_water_money`, 'GET')
}

// 充值水卡
export const addWaterMoney = (data) => {
  return axiosAPI(`${url}/user/water/add_water_money`, data, 'POST')
}

// 电费余额
export const getTariffMoney = () => {
  return axiosAPI(`${url}/user/tariff/get_tariff_money`, 'GET')
}

// 充值电费
export const addTariffMoney = (data) => {
  return axiosAPI(`${url}/user/tariff/add_tariff_money`, data, 'POST')
}
// 饭卡余额
export const getMealMoney = () => {
  return axiosAPI(`${url}/user/meal/get_meal_money`, 'GET')
}

// 充值饭卡
export const addMealMoney = (data) => {
  return axiosAPI(`${url}/user/meal/add_meal_money`, data, 'POST')
}

// 订单列表
export const getOrdersList = () => {
  return axiosAPI(`${url}/user/orders/get_user_orders`, 'GET')
}
// 通知列表
export const getNotifyList = () => {
  return axiosAPI(`${url}/user/notify/get_user_notify_list`, 'GET')
}
// 地址
export const getAddressList = () => {
  return axiosAPI(`${url}/list/api/address`, 'GET')
}